FROM golang:alpine3.7 AS build-stage
WORKDIR /go/src/finance
COPY . .
RUN go build -tags=jsoniter -o server

FROM alpine:3.7
ENV TZ=Asia/Shanghai

RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories \
  && apk --no-cache --update add tzdata
WORKDIR /go/src/app-market
COPY --from=build-stage /go/src/finance/server .
CMD ["./server"]
